﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" MaintainScrollPositionOnPostback="true" CodeBehind="RservacionesViewModify.aspx.cs" Inherits="Recursos.View.RservacionesViewModify" %>
<%@ Register TagPrefix="cc1" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit, Version=4.1.60919.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    
    <h2>Modificar Resevación</h2>
        
    
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
    
        
    
        
    
        
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    
        
     <asp:Label ID="Label1" runat="server" Text="Modalidad"></asp:Label>  
            &nbsp;  
            &nbsp;&nbsp;  
            <asp:DropDownList ID="DropDownListModalidad" runat="server" Height="17px">
            </asp:DropDownList>
    
        
    
        &nbsp;&nbsp;&nbsp;
           
    
        
    
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<p>
    
        
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Label ID="Label2" runat="server" Text="Periodo"></asp:Label>
    
        
    
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:DropDownList ID="DropDownListPeriodo" runat="server" Height="16px" 
            Width="93px">
                  <asp:ListItem>1</asp:ListItem>
                <asp:ListItem>2</asp:ListItem>
                <asp:ListItem>3</asp:ListItem>
                <asp:ListItem>4</asp:ListItem>
                <asp:ListItem>5</asp:ListItem>
                <asp:ListItem>6</asp:ListItem>
                <asp:ListItem>7</asp:ListItem>
                <asp:ListItem>8</asp:ListItem>
                <asp:ListItem>9</asp:ListItem>
                <asp:ListItem>10</asp:ListItem>
                <asp:ListItem>11</asp:ListItem>
                <asp:ListItem>12</asp:ListItem>
        </asp:DropDownList>
    <p>
    
        
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Label ID="Label3" runat="server" Text="Año"></asp:Label>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
        <asp:TextBox ID="TextBoxaño" runat="server" Height="21px" Width="88px"></asp:TextBox>
        <asp:CompareValidator ID="cv" runat="server" ControlToValidate="TextBoxaño" Type="Integer" ForeColor="red"
   Operator="DataTypeCheck" ErrorMessage="El año debe ser numero entero. " />
   
    <p>
    
        
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Label ID="Label4" runat="server" Text="Sede"></asp:Label>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
        <asp:DropDownList ID="DropDownListSedes" runat="server" 
            style="margin-bottom: 0px">
        </asp:DropDownList>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="ButtonBuscarReservaciones" runat="server" 
            Text="Buscar Reservaciones" onclick="ButtonBuscarReservaciones_Click" />
    <p>
    
        
        &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <h2>&nbsp;Reservaciones de cursos</h2>
    
        <br />
    <asp:GridView ID="GridView1" runat="server" CellPadding="3" GridLines="Horizontal"
   Font-Names="Verdana" Font-Size="10" DataKeyNames="id" OnRowDataBound="gridView_RowDataBound"
   AutoGenerateColumns="false" onrowcancelingedit="GridView1_RowCancelingEdit" 
        onrowediting="GridView1_RowEditing" onrowupdating="GridView1_RowUpdating" 
        Width="1150px" onrowdeleting="GridView1_RowDeleting1">
   
   <HeaderStyle BackColor="#336699" ForeColor="White" HorizontalAlign="Left" Height="25" />            
            
   <Columns>
      <asp:CommandField ButtonType="Button"  ShowEditButton="true" ShowCancelButton="true" EditText="Editar" CancelText="Cancelar" UpdateText="Actualizar"/>
      
      <asp:TemplateField >
        <ItemTemplate>
            <asp:Button ID="deleteButton" runat="server" CommandName="Delete" Text="Eliminar"
            OnClientClick="return confirm('Está seguro de que desea eliminar la Reservación?');" />
        </ItemTemplate>
      </asp:TemplateField> 

      <asp:BoundField DataField="id" HeaderText="" ReadOnly="true" Visible="False" />               
      
      <asp:TemplateField HeaderText="Profesor">
          <ItemTemplate>
            <%# Eval("Grupo.Usuario.Nombre")%>
          </ItemTemplate>
          <EditItemTemplate>
             <asp:DropDownList ID="DropdownProfe" runat="server" DataValueField="id"  DataTextField="Nombre" />
          </EditItemTemplate>
      </asp:TemplateField>         
      <asp:TemplateField HeaderText="Grupo">
          <ItemTemplate>
              <%# Eval("Grupo.Codigo")%>
          </ItemTemplate>
          <EditItemTemplate>
              <asp:DropDownList ID="DropdownGrupo" runat="server" DataValueField="id"  DataTextField="Codigo" />
          </EditItemTemplate>
      </asp:TemplateField>

       <asp:TemplateField HeaderText="Espacio">
          <ItemTemplate>
              <%# Eval("Reservacion.Espacio.Codigo")%>
          </ItemTemplate>
          <EditItemTemplate>
              <asp:DropDownList ID="DropdownEspacio" runat="server" DataValueField="id"  DataTextField="Codigo" />
          </EditItemTemplate>
      </asp:TemplateField>

      <asp:TemplateField HeaderText="Hora Inicio">
          <ItemTemplate>
              <%# Eval("Reservacion.HoraInicio")%>
          </ItemTemplate>
          <EditItemTemplate>
              <asp:DropDownList ID="DropDownListHoraInicio" runat="server" Height="19px" 
                Width="80px">
            <asp:ListItem>07:30</asp:ListItem>
            <asp:ListItem>08:30</asp:ListItem>
            <asp:ListItem>09:30</asp:ListItem>
            <asp:ListItem>10:30</asp:ListItem>
            <asp:ListItem>11:30</asp:ListItem>
            <asp:ListItem>14:00</asp:ListItem>
            <asp:ListItem>13:00</asp:ListItem>
            <asp:ListItem>16:00</asp:ListItem>
            <asp:ListItem>15:00</asp:ListItem>
            <asp:ListItem>18:00</asp:ListItem>
            <asp:ListItem>17:00</asp:ListItem>
            <asp:ListItem>21:00</asp:ListItem>
            <asp:ListItem>19:00</asp:ListItem>
        </asp:DropDownList>
          </EditItemTemplate>
      </asp:TemplateField>      
 
      <asp:TemplateField HeaderText="Hora Final" >
          <ItemTemplate>
              <%# Eval("Reservacion.HoraFinal")%>
          </ItemTemplate>
          <EditItemTemplate>
              <asp:DropDownList ID="DropDownListHoraFinal" runat="server" Height="18px" 
                Width="78px">
            <asp:ListItem>08:20</asp:ListItem>
            <asp:ListItem>09:20</asp:ListItem>
            <asp:ListItem>10:20</asp:ListItem>
            <asp:ListItem>11:20</asp:ListItem>
            <asp:ListItem>12:20</asp:ListItem>
            <asp:ListItem>13:50</asp:ListItem>
            <asp:ListItem>14:50</asp:ListItem>
            <asp:ListItem>15:50</asp:ListItem>
            <asp:ListItem>16:50</asp:ListItem>
            <asp:ListItem>17:50</asp:ListItem>
            <asp:ListItem>18:50</asp:ListItem>
            <asp:ListItem>19:50</asp:ListItem>
               <asp:ListItem>20:50</asp:ListItem>
               <asp:ListItem>21:50</asp:ListItem>
        </asp:DropDownList>
             </EditItemTemplate>
      </asp:TemplateField>  
    <asp:TemplateField HeaderText="Dias" >
          <ItemTemplate>
              <%# Eval("Reservacion.Dias")%>
          </ItemTemplate>
          <EditItemTemplate>
               <asp:CheckBox ID="cblunes" runat="server" Text="Lunes" /><p/>
                <asp:CheckBox ID="cbmartes" runat="server" Text="Martes" /><p/>
                 <asp:CheckBox ID="cbmiercoles" runat="server" Text="Miércoles" /><p/>
                  <asp:CheckBox ID="cbjueves" runat="server" Text="Jueves" /><p/>
                   <asp:CheckBox ID="cbviernes" runat="server" Text="Viernes" /><p/>
                    <asp:CheckBox ID="cbsabado" runat="server" Text="Sábado" /><p/>
             </EditItemTemplate>
      </asp:TemplateField>  
   
     

    </Columns>
            
</asp:GridView>

  <h2>  Reservaciones particulares</h2>
   




    <asp:GridView ID="GridView2" runat="server" CellPadding="3" GridLines="Horizontal"
   Font-Names="Verdana" Font-Size="10" DataKeyNames="id" OnRowDataBound="gridView2_RowDataBound"
   AutoGenerateColumns="false" onrowcancelingedit="GridView2_RowCancelingEdit" 
        onrowediting="GridView2_RowEditing" onrowupdating="GridView2_RowUpdating" 
        Width="821px" onrowdeleting="GridView2_RowDeleting1" >
   
   <HeaderStyle BackColor="#336699" ForeColor="White" HorizontalAlign="Left" Height="25" />            
            
   <Columns>
      <asp:CommandField ButtonType="Button" ShowEditButton="true" ShowCancelButton="true"  EditText="Editar" CancelText="Cancelar" UpdateText="Actualizar" />
                    
          <asp:TemplateField >
        <ItemTemplate>
            <asp:Button ID="deleteButton" runat="server" CommandName="Delete" Text="Eliminar"
            OnClientClick="return confirm('Está seguro de que desea eliminar la reservación?');" />
        </ItemTemplate>
      </asp:TemplateField> 

      <asp:BoundField DataField="id" HeaderText="" ReadOnly="true" Visible="False" />
           <asp:TemplateField HeaderText="Fecha Inicio">
          <ItemTemplate>
              <%# Eval("Reservacion.FechaInicio", "{0:dd/MM/yyyy}")%>
          </ItemTemplate>
          <EditItemTemplate>
          <asp:Image   
                  ID="Image1"  
                  runat="server"  
                  ImageUrl="~/img/calendar.png"  
                  /> 
                     <asp:TextBox ID="TextBox1" Text='<%# Eval("Reservacion.FechaInicio", "{0:dd/MM/yyyy}")%>' runat="server"  Height="23px" 
            Width="90px"></asp:TextBox>
            
              
                             
 <cc1:CalendarExtender ID="CalendarExtender1" PopupButtonID="Image1"
runat="server" TargetControlID="TextBox1"  Format="dd/MM/yyyy"/>
   <asp:RegularExpressionValidator id="RegularExpressionValidator2" runat="server" ErrorMessage="RegularExpressionValidator"  
                        ControlToValidate="TextBox1"  ForeColor="red"
                        ValidationExpression="^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((1[6-9]|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((1[6-9]|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((1[6-9]|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$">Formato de fecha dd/MM/aaaa</asp:RegularExpressionValidator></td>
 
          </EditItemTemplate>
      </asp:TemplateField>       
        <asp:TemplateField HeaderText="Fecha Final">
          <ItemTemplate>
              <%# Eval("Reservacion.FechaFinal", "{0:dd/MM/yyyy}")%>
          </ItemTemplate>
          <EditItemTemplate>
             <asp:Image   
                  ID="Image2"  
                  runat="server"  
                  ImageUrl="~/img/calendar.png"  
                  /> 
                     <asp:TextBox ID="TextBox2" Text='<%# Eval("Reservacion.FechaFinal", "{0:dd/MM/yyyy}")%>' runat="server"  Height="23px" 
            Width="90px"></asp:TextBox>
            
            <cc1:CalendarExtender ID="CalendarExtender2" PopupButtonID="Image2"
runat="server" TargetControlID="TextBox2"  Format="dd/MM/yyyy"/>
  
             <asp:RegularExpressionValidator id="RegularExpressionValidator3" runat="server" ErrorMessage="RegularExpressionValidator"  
                        ControlToValidate="TextBox2"  ForeColor="red"
                        ValidationExpression="^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((1[6-9]|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((1[6-9]|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((1[6-9]|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$">Formato de fecha dd/MM/aaaa</asp:RegularExpressionValidator></td>
                   
 
          </EditItemTemplate>
      </asp:TemplateField> 
      <asp:TemplateField HeaderText="Institución">
          <ItemTemplate>
              <%# Eval("InstitucionResponsable")%>
          </ItemTemplate>
          <EditItemTemplate>
              <asp:TextBox runat="server" ID="institucion" Text='<%# Eval("InstitucionResponsable")%>' Width="50px"/>
          </EditItemTemplate>
      </asp:TemplateField>                     
      
      <asp:TemplateField HeaderText="Responsable">
          <ItemTemplate>
            <%# Eval("NombreResponsable")%>
          </ItemTemplate>
          <EditItemTemplate>
            <asp:TextBox runat="server" ID="responsable" Text='<%# Eval("NombreResponsable")%>' Width="50px"/>
          </EditItemTemplate>
      </asp:TemplateField>         
      <asp:TemplateField HeaderText="Descripcion">
          <ItemTemplate>
              <%# Eval("Descripcion")%>
          </ItemTemplate>
          <EditItemTemplate>
              <asp:TextBox runat="server" ID="descripcion" Text='<%# Eval("Descripcion")%>' Width="50px"/>
          </EditItemTemplate>
      </asp:TemplateField>
      
      <asp:TemplateField HeaderText="Usuario">
          <ItemTemplate>
              <%# Eval("UsuarioResponsable")%>
          </ItemTemplate>
          <EditItemTemplate>
              <asp:TextBox runat="server" ID="usuario" Text='<%# Eval("UsuarioResponsable")%>' Width="50px"/>
          </EditItemTemplate>
      </asp:TemplateField>
 
            <asp:TemplateField HeaderText="Dias" >
          <ItemTemplate>
              <%# Eval("Reservacion.Dias")%>
          </ItemTemplate>
          <EditItemTemplate>
                            <asp:CheckBox ID="cblunes" runat="server" Text="L" /><p/>
                <asp:CheckBox ID="cbmartes" runat="server" Text="K" /><p/>
                 <asp:CheckBox ID="cbmiercoles" runat="server" Text="M" /><p/>
                  <asp:CheckBox ID="cbjueves" runat="server" Text="J" /><p/>
                   <asp:CheckBox ID="cbviernes" runat="server" Text="V" /><p/>
                    <asp:CheckBox ID="cbsabado" runat="server" Text="S" /><p/>
             </EditItemTemplate>
      </asp:TemplateField>  
       <asp:TemplateField HeaderText="Espacio">
          <ItemTemplate>
              <%# Eval("Reservacion.Espacio.Codigo")%>
          </ItemTemplate>
          <EditItemTemplate>
              <asp:DropDownList ID="DropdownEspacio" runat="server" DataValueField="id"  DataTextField="Codigo" />
          </EditItemTemplate>
      </asp:TemplateField>
       <asp:TemplateField HeaderText="De">
          <ItemTemplate>
              <%# Eval("Reservacion.HoraInicio")%>
          </ItemTemplate>
          <EditItemTemplate>
              <asp:DropDownList ID="DropDownListHoraInicio" runat="server" Height="19px" 
                Width="50px">
            <asp:ListItem>07:30</asp:ListItem>
            <asp:ListItem>08:30</asp:ListItem>
            <asp:ListItem>09:30</asp:ListItem>
            <asp:ListItem>10:30</asp:ListItem>
            <asp:ListItem>11:30</asp:ListItem>
            <asp:ListItem>14:00</asp:ListItem>
            <asp:ListItem>13:00</asp:ListItem>
            <asp:ListItem>16:00</asp:ListItem>
            <asp:ListItem>15:00</asp:ListItem>
            <asp:ListItem>18:00</asp:ListItem>
            <asp:ListItem>17:00</asp:ListItem>
            <asp:ListItem>21:00</asp:ListItem>
            <asp:ListItem>19:00</asp:ListItem>
        </asp:DropDownList>
          </EditItemTemplate>
      </asp:TemplateField>      
 
      <asp:TemplateField HeaderText="Hasta" >
          <ItemTemplate>
              <%# Eval("Reservacion.HoraFinal")%>
          </ItemTemplate>
          <EditItemTemplate>
              <asp:DropDownList ID="DropDownListHoraFinal" runat="server" Height="18px" 
                Width="50px">
            <asp:ListItem>08:20</asp:ListItem>
            <asp:ListItem>09:20</asp:ListItem>
            <asp:ListItem>10:20</asp:ListItem>
            <asp:ListItem>11:20</asp:ListItem>
            <asp:ListItem>12:20</asp:ListItem>
            <asp:ListItem>13:50</asp:ListItem>
            <asp:ListItem>14:50</asp:ListItem>
            <asp:ListItem>15:50</asp:ListItem>
            <asp:ListItem>16:50</asp:ListItem>
            <asp:ListItem>17:50</asp:ListItem>
            <asp:ListItem>18:50</asp:ListItem>
            <asp:ListItem>19:50</asp:ListItem>
               <asp:ListItem>20:50</asp:ListItem>
               <asp:ListItem>21:50</asp:ListItem>
        </asp:DropDownList>
             </EditItemTemplate>
      </asp:TemplateField>  
    
    </Columns>
            
</asp:GridView>





</p>
    <p>
    </p>
</asp:Content>
